home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 3381 < prev    next >
Encoding:
Text File  |  1996-08-05  |  872 b   |  33 lines

  1. Path: mail2news.demon.co.uk!gate.demon.co.uk
  2. From: "Paul F. Robinson" <pfr@doodey.demon.co.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: command line argument help
  5. Date: Sun, 28 Jan 96 14:43:51 GMT
  6. Organization: Private node
  7. Message-ID: <9601281443.AA0001h@doodey.demon.co.uk>
  8. References: <4edfth$ok@muss.CIS.McMaster.CA>
  9. X-NNTP-Posting-Host: gate.demon.co.uk
  10. X-Newsreader: TIN [AMIGA 1.3 950726BETA PL0]
  11. X-Mail2News-Path: relay-1.mail.demon.net!gate.demon.co.uk
  12.  
  13. shadowfax wrote:
  14. : i am not having too much success with command line arguments.  i am 
  15.  [snip]
  16. :
  17. : int main(char *argv[])
  18. : {
  19.  [snip]
  20. : when i compile and run, it always outputs an anser of 0.  can anyone tell 
  21. : me what's wrong?
  22.  
  23. If you want to use argv, your main() function should start 
  24.  
  25.     int main(int argc, char *argv[]) 
  26.     {
  27.  
  28. even if you don't want to use argc.
  29. See K&R 2nd ed. chapter 5.10
  30.  
  31. Paul.
  32.